﻿using System;

namespace SS4U.Controls
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            var searcher = new Library.Searcher();
            var results = searcher.Search(txtSearchPhrase.Text, null, null);
            Message.Text = string.Format("{0} results found", results.Count);
            repeater1.DataSource = results;
            repeater1.DataBind();
        }

        protected void btnCreateConfig_Click(object sender, EventArgs e)
        {
            Library.Configuration.CreateSampleConfiguration();
            Message.Text = "Sample Configuration written";
        }

        protected void btnReloadConfig_Click(object sender, EventArgs e)
        {
            Library.Configuration.ReloadConfiguration();
            Message.Text = "Configuration reloaded";
        }
    }
}
